Skip to content

Initial work for versionsuffix and external-id - #2555

Merged
fitzgen merged 4 commits into
bytecodealliance:mainfrom
alexcrichton:external-id
Jul 2, 2026
Merged

fitzgen merged 4 commits into
bytecodealliance:mainfrom
alexcrichton:external-id

Conversation

@alexcrichton

@alexcrichton alexcrichton commented Jul 1, 2026

Copy link
Copy Markdown
Member

This is intended to at least start laying groundwork and implementation for two features in the component model that this repository does not yet implement:

  • (versionsuffix "...") for components -- introduced in Interface version canonicalization WebAssembly/component-model#536 this is intended to pave a path forward to canonicalizing versions in component imports/exports in the future. For example where today you'd import a:b/c@1.0.0 tomorrow you'd import a:b/c@1. This is not yet fully integrated into wit-component, however, and further work will be necessary for bindings generators as well to take advantage of this. It's all encoded in the same place as external-id, though, so I figured I'd at least start to lay the groundwork.

  • (external-id "...") for components -- being introduced in Add external-id attribute WebAssembly/component-model#672 this is intended to attach arbitrary metadata to imports/exports in a component. This is surfaced in WIT as an @external-id("...") attribute. This should be hooked up throughout this implementation to WIT and such such that the implementation is intended to be complete. There's probably something I forgot, but all the major pieces should be there.

The versionsuffix parsing/validation is gated by a new cm-canon-names feature, and the external-id parsing/validation is gated behind the preexisting cm-implements feature to match the specification's classification.

Closes #2551

This is intended to at least start laying groundwork and implementation
for two features in the component model that this repository does not
yet implement:

* `(versionsuffix "...")` for components -- introduced in
  WebAssembly/component-model#536 this is intended to pave a path
  forward to canonicalizing versions in component imports/exports in the
  future. For example where today you'd import `a:b/c@1.0.0` tomorrow
  you'd import `a:b/c@1`. This is not yet fully integrated into
  `wit-component`, however, and further work will be necessary for
  bindings generators as well to take advantage of this. It's all
  encoded in the same place as `external-id`, though, so I figured I'd
  at least start to lay the groundwork.

* `(external-id "...")` for components -- being introduced in
  WebAssembly/component-model#672 this is intended to attach arbitrary
  metadata to imports/exports in a component. This is surfaced in WIT as
  an `@external-id("...")` attribute. This should be hooked up
  throughout this implementation to WIT and such such that the
  implementation is intended to be complete. There's probably something
  I forgot, but all the major pieces should be there.

The `versionsuffix` parsing/validation is gated by a new
`cm-canon-names` feature, and the `external-id` parsing/validation is
gated behind the preexisting `cm-implements` feature to match the
specification's classification.
@alexcrichton
alexcrichton requested a review from a team as a code owner July 1, 2026 23:00
@alexcrichton
alexcrichton requested review from fitzgen and removed request for a team July 1, 2026 23:00
@ricochet

ricochet commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Heads up that gating external-id to instances is different from the spec PR. IMO gating on instances is the right call so we should funnel that back to the spec. AKA right now this PR has external_id only on WorldItem::Interface, not on Function/TypeDef.

Right now the Explainer's motivating example puts external-id on a bare func import:

(component $ESM
  (import "slugify"
    (external-id "https://esm.unpkg.com/slugify@1.6.6")
    (func (param "text" string) (result string)))
)

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fitzgen
fitzgen added this pull request to the merge queue Jul 2, 2026
Merged via the queue into bytecodealliance:main with commit a001d3c Jul 2, 2026
37 checks passed
@alexcrichton
alexcrichton deleted the external-id branch July 2, 2026 19:55
PhoebeSzmucer pushed a commit to PhoebeSzmucer/wasm-tools that referenced this pull request Jul 7, 2026
This commit extends the work done in bytecodealliance#2555 to support `@external-id` on
all component model items and notably in more locations in WIT. This
required mostly work on the WIT side of things to ensure that it's
plumbed everywhere.
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this pull request Sep 9, 2026
Added in bytecodealliance#2555 but I forgot to document it at the time.
chacailline pushed a commit to chacailline/wasm-tools that referenced this pull request Sep 11, 2026
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
wasm-tools 1.253.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* Limit the element count of fixed-length lists by @eyupcanakman in bytecodealliance/wasm-tools#2537
* wasmparser: Rename BinaryReaderError to Error by @lann in bytecodealliance/wasm-tools#2546
* fix: signature lowering for strings and lists on modules with 64bit memory by @christoph-dfinity in bytecodealliance/wasm-tools#2544
* json-from-wast: name emitted files after the output stem by @eyupcanakman in bytecodealliance/wasm-tools#2542
* Refactor `KebabStr` to not require unsafe code by @alexcrichton in bytecodealliance/wasm-tools#2548
* Add CustomSectionReader -> BinaryReader conversion by @WorldSEnder in bytecodealliance/wasm-tools#2550
* wasmparser: Add Error::missing_wasm_feature by @lann in bytecodealliance/wasm-tools#2549
* fix: use ptr-sized type when returning via ptr indirection under memory64 by @christoph-dfinity in bytecodealliance/wasm-tools#2553
* Synchronize threading intrinsics with specification by @alexcrichton in bytecodealliance/wasm-tools#2554
* Remove `resource.drop async` by @alexcrichton in bytecodealliance/wasm-tools#2552
* Initial work for `versionsuffix` and `external-id` by @alexcrichton in bytecodealliance/wasm-tools#2555
* Make parsing errors downcastable by @PhoebeSzmucer in bytecodealliance/wasm-tools#2557
* Add `SourceMap::resolve_span` for resolving global span locations by @PhoebeSzmucer in bytecodealliance/wasm-tools#2559
* Render error by @PhoebeSzmucer in bytecodealliance/wasm-tools#2560
* Support `external-id` on more items by @alexcrichton in bytecodealliance/wasm-tools#2558
* Release wasm-tools 1.253.0 by @github-actions[bot] in bytecodealliance/wasm-tools#2561

## New Contributors
* @christoph-dfinity made their first contribution in bytecodealliance/wasm-tools#2544

**Full Changelog**: https://github.com/bytecodealliance/wasm-tools/compare/v1.252.0...v1.253.0</pre>
  <p>View the full release notes at <a href="https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.253.0">https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.253.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!13746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wast: WASM_PARENS_DEPTH too high on aarch64-unknown-linux-gnu

3 participants